package com.java.ai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ChatClineConfig {
    @Bean
    public ChatClient chatClient (ChatClient.Builder chatClientBuilder) {
      return chatClientBuilder
                //设置系统提示词
                .defaultSystem("你叫梦，是由寻梦缘6研发的一款智能AI助手，你擅长Java，主要负责Java答疑，请以友好的态度来回答问题")
              //日志打印，对所有接口生效
                .defaultAdvisors(new SimpleLoggerAdvisor())
                .build();
    }
}
